%% task6_2_2_2.m

clear;
load("../data/Guitar.mat", "realwave", "wave2proc");
Samp = 8000;

time_real = 0 : 10 / (length(realwave) - 1) : 10;
ts_real = timeseries(realwave, time_real, 'Name', 'RealWave');

time_resample = 0 : 10 / 249 : 10;
ts_resample = resample(ts_real, time_resample);

% plot(ts_resample.Time, ts_resample.Data, 'r', ts_real.Time, ts_real.Data, 'b')

temp = reshape(ts_resample.Data, [25 10]).';

proc = mean(temp);

proc = repmat(proc, 1, 10);

plot(time_real, realwave, 'm', 0:10/(length(wave2proc)-1):10, wave2proc, 'k', time_resample, proc, 'r');